package com.winspread.app.hitl.binds

import com.winspread.app.hitl.room.Book
import com.winspread.app.hitl.room.BookDao
import javax.inject.Inject
import javax.inject.Named

/**
 *Author: Amin
 *Data: 2022/4/19 11:39
 *
 *Description:
 *
 */
class BookConditionImpl @Inject constructor() : IBook {


    @Inject
    @field:[Named("BOOK")]
    lateinit var bookDao: BookDao

    override suspend fun saveBook(name: String) {
        if (name == "Android艺术") {
            bookDao.insertAll(Book(name))
        }
    }

    override suspend fun getBookAllSum(): Int {
        return bookDao.queryBookAll()
    }

}